package com.nts.visionworks.business.streamevent.domain;

// Generated 2013. 6. 23 ���� 6:33:40 by Hibernate Tools 4.0.0

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;

import org.hibernate.validator.constraints.Range;

import com.nts.visionworks.core.validation.EntityIdNotNull;

/**
 * StreamSynapseTransmitter generated by hbm2java
 */
@Entity
@Table(name = "stream_synapse_transmitter", catalog = "visionworks")
public class StreamSynapseTransmitter implements java.io.Serializable
{

	private Integer transmitterId;
	private StreamSynapse streamSynapse;
	private short variableType;
	private Integer variableLength;
	private boolean notNull;

	public StreamSynapseTransmitter()
	{
	}

	public StreamSynapseTransmitter(StreamSynapse streamSynapse,
			short variableType, boolean notNull)
	{
		this.streamSynapse = streamSynapse;
		this.variableType = variableType;
		this.notNull = notNull;
	}

	public StreamSynapseTransmitter(StreamSynapse streamSynapse,
			short variableType, Integer variableLength, boolean notNull)
	{
		this.streamSynapse = streamSynapse;
		this.variableType = variableType;
		this.variableLength = variableLength;
		this.notNull = notNull;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "TransmitterId", unique = true, nullable = false)
	public Integer getTransmitterId()
	{
		return this.transmitterId;
	}

	public void setTransmitterId(Integer transmitterId)
	{
		this.transmitterId = transmitterId;
	}

	@EntityIdNotNull(message = "validation.streamSynapseTransmitter.streamSynapse.notNull")
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "SynapseId", nullable = false)
	public StreamSynapse getStreamSynapse()
	{
		return this.streamSynapse;
	}

	public void setStreamSynapse(StreamSynapse streamSynapse)
	{
		this.streamSynapse = streamSynapse;
	}

	@NotNull(message = "validation.streamSynapseTransmitter.variableType.notNull")
	@Range(message = "validation.streamSynapseTransmitter.variableType.range", max = 6, min = 0)
	@Column(name = "VariableType", nullable = false)
	public short getVariableType()
	{
		return this.variableType;
	}

	public void setVariableType(short variableType)
	{
		this.variableType = variableType;
	}

	@Column(name = "VariableLength")
	public Integer getVariableLength()
	{
		return this.variableLength;
	}

	public void setVariableLength(Integer variableLength)
	{
		this.variableLength = variableLength;
	}

	@Column(name = "NotNull", nullable = false)
	public boolean isNotNull()
	{
		return this.notNull;
	}

	public void setNotNull(boolean notNull)
	{
		this.notNull = notNull;
	}

}
